﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace nelech.Controllers.Utils
{
    public class IntComparer : IComparer<int>
    {
        #region IComparer<int> Members

        public int Compare(int x, int y)
        {
            return x - y;
        }

        #endregion
    }

    public class ReverseIntComparer : IComparer<int>
    {
        #region IComparer<int> Members

        public int Compare(int x, int y)
        {
            return y - x;
        }

        #endregion
    }

    public class DateComparer : IComparer<DateTime>
    {
        #region IComparer<date> Members

        public int Compare(DateTime x, DateTime y)
        {
            if (x == y)
                return 0;
            if (x > y)
                return 1;
            return -1;
        }

        #endregion
    }
}
